<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    var a = "hello 千锋";
    console.log( a );
    console.log( window.a );

    var o = {};
    console.log( o )
    console.log( window.o )
    console.log( window.o === o );

    // window.alert("hello alert");

    window.document.write("<mark>12124</mark>");

    var n = window.parseInt(3.1415)
    console.log(n);


    // =======

    function fn(){
        console.log("hello fn 千锋")
        console.log( this );
        console.log( window );
        console.log( window === this );
    }
    fn();
    window.fn();
    console.log(fn === window.fn)


    ;(function(){

        function fun(){
            console.log("hello fun 千锋");
            console.log( this );
            console.log( window );
            console.log( window === this );
        }
        fun();

    })();


    function box( f ){
        f();
    }
    box( function(){
        console.log("hello box的参数 千锋")
        console.log( this );
        console.log( window );
        console.log( window === this );
    } );

    // 全局：window.xxx
    // 局部，配合：this

    ;(function(){
        window.msg = "千锋H5";
    })();

    ;(function(){
        console.log(msg);
    })();

    console.log(msg);
    
</script>
</html>